/*
 * main.c
 *
 * Copyright (C) 2019 - michael
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
#include "../lib/libreserve/reserve_mgr.h"
#include "../lib/libsouthio/south_io.h"
#include "../lib/libnorthio/north_io.h"
#include "../lib/libsched/global_sched.h"
#include "../lib/libstate/state_mgr.h"

int main()
{
	struct global_reserve_table *tbl = NULL;
//	pthread_t pt;

	init_north_io();
	init_topology();
	print_topology();
	init_global_resource();
	print_global_resource();
	init_state_list();
//	pt = tsn_create_timer(state_list_process, 1);
	tbl = init_global_reserve_table();
	init_south_io();
	TSN_DBG("****************init south io success!******************\n");
	global_flow_resource_sched(tbl);
	
//	pthread_join(pt, NULL);
	while(1){sleep(9999);}
	return G_OK;
}